﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SerialAssist
{
    public partial class frmAdd : Form
    {
        public string ContentName
        {
            get
            {
                return txbName.Text;
            }
            set
            {
                txbName.Text = value;
            }
        }

        public string Content
        {
            get
            {
                return txbContent.Text;
            }
            set
            {
                txbContent.Text = value;
            }
        }

        private bool _Modify = false;
        public bool Modify
        {
            get
            {
                return _Modify;
            }
            set
            {
                if(value)
                {
                    btnAdd.Text = "修改";
                    this.Text = "修改";
                }
                else
                {
                    btnAdd.Text = "添加";
                    this.Text = "添加";
                }
                _Modify = value;
            }
        }

        public frmAdd()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
